package demo1;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 98152
 * Date: 2024-07-06
 * Time: 16:05
 */

class Animal {
    public String name;
    public int age;
}
class Dog extends Animal {
    public void bark() {
        System.out.println("汪汪叫");
    }
    public void eat() {
        System.out.println("吃狗粮");
    }
}
class Cat extends Animal {
    public void mimi() {
        System.out.println("喵喵叫");
    }
    public void eat() {
        System.out.println("吃猫粮");
    }
}
public class TestDemo1 {
    public static void main(String[] args) {
        Dog dog = new Dog();
        Cat cat = new Cat();
        dog.bark();
        dog.eat();
        cat.mimi();
        cat.eat();
    }
}
